<template>
  <div>
    <el-form ref="form" inline :model="dialog.data" label-width="100px" size="small" class="xsxq">
      <el-collapse v-model="dialog.active">
        <el-collapse-item title="固定字段" name="1">
          <table border="1" style="width:100%;border:solid 1px #ccc;" class="zp">
            <tr>
              <td
                rowspan="3"
                style="width:110px;text-align: center;line-height: 130px;height:150px"
              >
                <img
                  v-if="dialog.data.studentHead"
                  style="max-height:150px;max-width:110px"
                  :src="dialog.data.studentHead"
                  alt
                />
                <div v-else class="img"></div>
              </td>
              <td width="90">
                <label class="el-form-item__label">
                  <span style="color: red;">*</span>学校名称：
                </label>
              </td>
              <td width="210">
                <div class="el-form-item__content">
                  <span>{{dialog.data.schoolName}}</span>
                </div>
              </td>
              <td width="128">
                <label class="el-form-item__label">当前所在学校编码：</label>
              </td>
              <td width="210">
                <div class="el-form-item__content">
                  <span v-if="!isGroupManager">{{dialog.data.schoolCode}}</span>
                  <span v-else>{{dialog.data.schoolCode}}</span>
                </div>
              </td>
              <td width="100">
                <label class="el-form-item__label">学段：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <span>{{dialog.data.sectionName}}</span>
                </div>
              </td>
            </tr>
            <tr>
              <td>
                <label class="el-form-item__label">年级：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.gradeId"
                    placeholder="请选择年级"
                    v-if="dialog.modify"
                    @change="searClass1"
                  >
                    <el-option
                      v-for="item in dialog.data.gradeList"
                      :key="item.gradeId"
                      :label="item.gradeName"
                      :value="item.gradeId"
                    ></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.gradeName}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">班级：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.classId"
                    placeholder="请选择班级"
                    v-if="dialog.modify"
                    @change="searSection"
                  >
                    <el-option
                      v-for="item in dialog.data.classList"
                      :key="item.classId"
                      :label="item.className"
                      :value="item.classId"
                    ></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.className}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">学籍所在学校：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-input
                    placeholder="请输入学籍所在学校"
                    v-if="dialog.modify"
                    v-model="dialog.data.studentStatusSchoolName"
                    clearable
                  ></el-input>
                  <span v-else>{{dialog.data.studentStatusSchoolName}}</span>
                </div>
              </td>
            </tr>
            <tr>
              <td>
                <label class="el-form-item__label">原就读学校：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-input
                    placeholder="请输入原就读学校"
                    v-if="dialog.modify"
                    v-model="dialog.data.attendSchoolName"
                    clearable
                  ></el-input>
                  <span v-else>{{dialog.data.attendSchoolName}}</span>
                </div>
              </td>

              <td>
                <label class="el-form-item__label">省网学籍号：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-input
                    placeholder="请输入省网学籍号"
                    v-if="dialog.modify"
                    v-model="dialog.data.provinceStudentCode"
                    clearable
                  ></el-input>
                  <span v-else>{{dialog.data.provinceStudentCode}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">国网学籍号：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-input
                    placeholder="请输入国网学籍号"
                    v-if="dialog.modify"
                    v-model="dialog.data.countryStudentCode"
                    clearable
                  ></el-input>
                  <span v-else>{{dialog.data.countryStudentCode}}</span>
                </div>
              </td>
            </tr>
          </table>
          <table border="1" style="width:100%;border:solid 1px #ccc;margin-top:-1px" class="zp">
            <tr>
              <td width="140">
                <label class="el-form-item__label">
                  <span style="color: red;">*</span>学生名称：
                </label>
              </td>
              <td width="240">
                <div class="el-form-item__content">
                  <el-input
                    placeholder="请输入学生名称"
                    v-if="dialog.modify"
                    v-model="dialog.data.studentName"
                    clearable
                  ></el-input>
                  <span v-else>{{dialog.data.studentName}}</span>
                </div>
              </td>
              <td width="120">
                <label class="el-form-item__label">学号：</label>
              </td>
              <td width="240">
                <div class="el-form-item__content">
                  <span>{{dialog.data.studentCode}}</span>
                </div>
              </td>
              <td width="100">
                <label class="el-form-item__label">
                  <span style="color: red;">*</span>身份证号：
                </label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-input
                    placeholder="请输入身份证号"
                    v-if="dialog.modify"
                    v-model="dialog.data.identityCardNumber"
                    clearable
                  ></el-input>
                  <span v-else>{{dialog.data.identityCardNumber}}</span>
                </div>
              </td>
            </tr>
            <tr>
              <td>
                <label class="el-form-item__label">
                  <span style="color: red;">*</span>性别：
                </label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select v-model="dialog.data.sex" placeholder="请选择性别" v-if="dialog.modify">
                    <el-option label="男" value="男"></el-option>
                    <el-option label="女" value="女"></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.sex}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">
                  <span style="color: red;">*</span>民族：
                </label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select v-model="dialog.data.nation" placeholder="请选择民族" v-if="dialog.modify">
                    <el-option
                      v-for="item in dialog.data.nationList"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    ></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.nation}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">政治面貌：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.politicsFace"
                    placeholder="请选择政治面貌"
                    v-if="dialog.modify"
                  >
                    <el-option
                      v-for="item in dialog.data.politicsFaceList"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    ></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.politicsFace}}</span>
                </div>
              </td>
            </tr>
            <tr>
              <td>
                <label class="el-form-item__label">出生日期：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-date-picker
                    v-model="dialog.data.birthday"
                    type="date"
                    v-if="dialog.modify"
                    placeholder="选择出生日期"
                    value-format="yyyy-MM-dd"
                    :picker-options="pickerOptions"
                  ></el-date-picker>
                  <span v-else>{{dialog.data.birthday}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">
                  <span style="color: red;">*</span>届次：
                </label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-input
                    placeholder="请输入届次"
                    v-if="dialog.modify"
                    v-model="dialog.data.finishSchoolYear"
                    clearable
                  ></el-input>
                  <span v-else>{{dialog.data.finishSchoolYear}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">选科：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.selectSubjects"
                    placeholder="请选择选科"
                    v-if="dialog.modify"
                  >
                    <el-option
                      v-for="item in dialog.data.selectSubjectList"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    ></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.selectSubjects}}</span>
                </div>
              </td>
            </tr>
            <tr>
              <td>
                <label class="el-form-item__label">户口类型：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.residentType"
                    placeholder="请选择户口类型"
                    v-if="dialog.modify"
                  >
                    <el-option
                      v-for="item in dialog.data.residentTypeList"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    ></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.residentType}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">籍贯：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-input
                    placeholder="请输入籍贯"
                    v-if="dialog.modify"
                    v-model="dialog.data.nativePlace"
                    clearable
                  ></el-input>
                  <span v-else>{{dialog.data.nativePlace}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">
                  <span style="color: red;">*</span>学籍状态：
                </label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.studentStatusState"
                    placeholder="请选择学籍状态"
                    v-if="dialog.modify"
                  >
                    <el-option
                      v-for="item in dialog.data.studentStatusStateList"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    ></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.studentStatusState}}</span>
                </div>
              </td>
            </tr>
            <tr>
              <td>
                <label class="el-form-item__label">培养方向：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.fosterDirection"
                    placeholder="请选择培养方向"
                    v-if="dialog.modify"
                  >
                    <el-option
                      v-for="item in dialog.data.fosterDirectionList"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    ></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.fosterDirection}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">缴费类别：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.paymentCategory"
                    placeholder="请选择缴费类别"
                    v-if="dialog.modify"
                  >
                    <el-option
                      v-for="item in dialog.data.paymentCategoryList"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    ></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.paymentCategory}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">
                  <span style="color: red;">*</span>是否住校：
                </label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.isResidence"
                    placeholder="请选择是否住校"
                    v-if="dialog.modify"
                  >
                    <el-option label="是" value="是"></el-option>
                    <el-option label="否" value="否"></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.isResidence}}</span>
                </div>
              </td>
            </tr>
            <tr>
              <td>
                <label class="el-form-item__label">是否残疾：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.isDisability"
                    placeholder="请选择是否残疾"
                    v-if="dialog.modify"
                  >
                    <el-option label="是" value="是"></el-option>
                    <el-option label="否" value="否"></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.isDisability}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">是否孤儿：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.isOrphan"
                    placeholder="请选择是否孤儿"
                    v-if="dialog.modify"
                  >
                    <el-option label="是" value="是"></el-option>
                    <el-option label="否" value="否"></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.isOrphan}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">是否贫困生：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.isPoorStudent"
                    placeholder="请选择是否贫困生"
                    v-if="dialog.modify"
                  >
                    <el-option label="是" value="是"></el-option>
                    <el-option label="否" value="否"></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.isPoorStudent}}</span>
                </div>
              </td>
            </tr>
            <tr>
              <td>
                <label class="el-form-item__label">是否烈士或优抚子女：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.isMartyrOrCaressChildren"
                    placeholder="请选择是否烈士或优抚子女"
                    v-if="dialog.modify"
                  >
                    <el-option label="是" value="是"></el-option>
                    <el-option label="否" value="否"></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.isMartyrOrCaressChildren}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">总分是否含加分：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.isBonusPoints"
                    placeholder="请选择总分是否含加分"
                    v-if="dialog.modify"
                  >
                    <el-option label="是" value="是"></el-option>
                    <el-option label="否" value="否"></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.isBonusPoints}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">加分类型：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.bonusType"
                    placeholder="请选择加分类型"
                    v-if="dialog.modify"
                  >
                    <el-option
                      v-for="item in dialog.data.bonusTypeList"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id"
                    ></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.bonusType}}</span>
                </div>
              </td>
            </tr>
            <tr>
              <td>
                <label class="el-form-item__label">加分分数：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-input
                    placeholder="请输入加分分数"
                    v-if="dialog.modify"
                    v-model="dialog.data.bonusScore"
                    clearable
                  ></el-input>
                  <span v-else>{{dialog.data.bonusScore}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">是否高补生：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.isReread"
                    placeholder="请选择是否高补生"
                    v-if="dialog.modify"
                  >
                    <el-option label="是" value="是"></el-option>
                    <el-option label="否" value="否"></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.isLefBehindChildren}}</span>
                </div>
              </td>
              <td>
                <label class="el-form-item__label">是否留守儿童：</label>
              </td>
              <td>
                <div class="el-form-item__content">
                  <el-select
                    v-model="dialog.data.isLefBehindChildren"
                    placeholder="请选择是否留守儿童"
                    v-if="dialog.modify"
                  >
                    <el-option label="是" value="是"></el-option>
                    <el-option label="否" value="否"></el-option>
                  </el-select>
                  <span v-else>{{dialog.data.isLefBehindChildren}}</span>
                </div>
              </td>
              <td></td>
              <td></td>
            </tr>
          </table>
        </el-collapse-item>
        <el-collapse-item title="自定义字段" name="2">
          <table border="1" class="zp" style="width:100%;border:solid 1px #ccc;">
            <template v-for="(itme,i) in dialog.data.fieldList">
              <tr :key="i" v-if="i%3==0">
                <td>
                  <label class="el-form-item__label">{{itme.fieldName}}：</label>
                </td>
                <td style="width:180px">
                  <div class="el-form-item__content" style="width:auto">
                    <el-input
                      :placeholder="'请输入'+itme.fieldName"
                      v-if="dialog.modify&&itme.fieldType=='01'"
                      v-model="itme.fieldValue"
                      clearable
                    ></el-input>
                    <el-input-number
                      v-model="itme.fieldValue"
                      v-else-if="dialog.modify&&itme.fieldType=='02'"
                      :label="'请输入'+itme.fieldName"
                    ></el-input-number>
                    <el-date-picker
                      v-model="itme.fieldValue"
                      type="date"
                      :placeholder="'请选择'+itme.fieldName"
                      v-else-if="dialog.modify&&itme.fieldType=='03'"
                    ></el-date-picker>
                    <el-input
                      v-else-if="dialog.modify&&itme.fieldType == '05'"
                      v-model="itme.fieldValue"
                      size="small"
                    ></el-input>
                    <!--手机号码-->
                    <el-input
                      v-else-if="dialog.modify&&itme.fieldType == '06'"
                      v-model="itme.fieldValue"
                      size="small"
                    ></el-input>
                    <!--身份证号-->
                    <el-input
                      v-else-if="dialog.modify&&itme.fieldType == '07'"
                      v-model="itme.fieldValue"
                      size="small"
                    ></el-input>
                    <!--邮箱-->
                    <span v-else>{{itme.fieldValue}}</span>
                  </div>
                </td>
                <td>
                  <label
                    v-if="dialog.data.fieldList[i+1]"
                    class="el-form-item__label"
                  >{{dialog.data.fieldList[i+1].fieldName}}：</label>
                </td>
                <td style="width:180px">
                  <div v-if="dialog.data.fieldList[i+1]" class="el-form-item__content">
                    <el-input
                      :placeholder="'请输入'+dialog.data.fieldList[i+1].fieldName"
                      v-if="dialog.modify&&dialog.data.fieldList[i+1].fieldType=='01'"
                      v-model="dialog.data.fieldList[i+1].fieldValue"
                      clearable
                    ></el-input>
                    <el-input-number
                      v-model="dialog.data.fieldList[i+1].fieldValue"
                      v-else-if="dialog.modify&&dialog.data.fieldList[i+1].fieldType=='02'"
                      :label="'请输入'+dialog.data.fieldList[i+1].fieldName"
                    ></el-input-number>
                    <el-date-picker
                      v-model="dialog.data.fieldList[i+1].fieldValue"
                      type="date"
                      :placeholder="'请选择'+dialog.data.fieldList[i+1].fieldName"
                      v-else-if="dialog.modify&&dialog.data.fieldList[i+1].fieldType=='03'"
                    ></el-date-picker>
                    <el-input
                      v-else-if="dialog.modify&&dialog.data.fieldList[i+1].fieldType == '05'"
                      v-model="dialog.data.fieldList[i+1].fieldValue"
                      size="small"
                    ></el-input>
                    <!--手机号码-->
                    <el-input
                      v-else-if="dialog.modify&&dialog.data.fieldList[i+1].fieldType == '06'"
                      v-model="dialog.data.fieldList[i+1].fieldValue"
                      size="small"
                    ></el-input>
                    <!--身份证号-->
                    <el-input
                      v-else-if="dialog.modify&&dialog.data.fieldList[i+1].fieldType == '07'"
                      v-model="dialog.data.fieldList[i+1].fieldValue"
                      size="small"
                    ></el-input>
                    <!--邮箱-->
                    <span v-else>{{dialog.data.fieldList[i+1].fieldValue}}</span>
                  </div>
                </td>
                <td>
                  <label
                    v-if="dialog.data.fieldList[i+2]"
                    class="el-form-item__label"
                  >{{dialog.data.fieldList[i+2].fieldName}}：</label>
                </td>
                <td style="width:180px">
                  <div v-if="dialog.data.fieldList[i+2]" class="el-form-item__content">
                    <el-input
                      :placeholder="'请输入'+dialog.data.fieldList[i+2].fieldName"
                      v-if="dialog.modify&&dialog.data.fieldList[i+2].fieldType=='01'"
                      v-model="dialog.data.fieldList[i+2].fieldValue"
                      clearable
                    ></el-input>
                    <el-input-number
                      v-model="dialog.data.fieldList[i+2].fieldValue"
                      v-else-if="dialog.modify&&dialog.data.fieldList[i+2].fieldType=='02'"
                      :label="'请输入'+dialog.data.fieldList[i+2].fieldName"
                    ></el-input-number>
                    <el-date-picker
                      v-model="dialog.data.fieldList[i+2].fieldValue"
                      type="date"
                      :placeholder="'请选择'+dialog.data.fieldList[i+2].fieldName"
                      v-else-if="dialog.modify&&dialog.data.fieldList[i+2].fieldType=='03'"
                    ></el-date-picker>
                    <el-input
                      v-else-if="dialog.modify&&dialog.data.fieldList[i+2].fieldType == '05'"
                      v-model="dialog.data.fieldList[i+2].fieldValue"
                      size="small"
                    ></el-input>
                    <!--手机号码-->
                    <el-input
                      v-else-if="dialog.modify&&dialog.data.fieldList[i+2].fieldType == '06'"
                      v-model="dialog.data.fieldList[i+2].fieldValue"
                      size="small"
                    ></el-input>
                    <!--身份证号-->
                    <el-input
                      v-else-if="dialog.modify&&dialog.data.fieldList[i+2].fieldType == '07'"
                      v-model="dialog.data.fieldList[i+2].fieldValue"
                      size="small"
                    ></el-input>
                    <!--邮箱-->
                    <span v-else>{{dialog.data.fieldList[i+2].fieldValue}}</span>
                  </div>
                </td>
              </tr>
            </template>
          </table>
        </el-collapse-item>
      </el-collapse>
    </el-form>
  </div>
</template>

<script>
export default {};
</script>

<style>
</style>